﻿@model string

@{
    var routeData = ViewContext.RouteData.Values.Where(r => r.Key == "id");
    string controlValue = routeData.Any() ? routeData.FirstOrDefault().Value.ToString() : string.Empty;
}

@(Html.Kendo().AutoComplete()
    .Name(Model)
    .Filter("contains")
    .MinLength(3)
    .Suggest(false)
    .HtmlAttributes(new { style = "width:300px" })
    .Value(controlValue)
    .DataSource(source =>
    {
        source.Read(read =>
        {
            read.Action("GetCombinedAutoCompleteList", "Json", new { @area = string.Empty })
                .Data(Model +"AdditionalData");
        })
        .ServerFiltering(true);
    })
    .Events(e => e.Change(Model + "_onChange")
    )
)